/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Componentes.Texfields;

import java.awt.Color;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import org.edisoncor.gui.passwordField.PasswordFieldRound;
import org.edisoncor.gui.textField.TextFieldRoundIcon;

/**
 *
 * @author luisramirezmartinez SAMI 2011
 *
 */
public final class txtPassword  extends PasswordFieldRound {
    
    
    private String Frase="";
    private Color colorsub = Color.gray;
    private Color colorTexto;
    
    
    
 
    public txtPassword(){
        super();
        this.colorTexto=getForeground();
        
        this.addFocusListener(new FocusAdapter() {
            @Override
            public void focusGained(FocusEvent fe) {
                super.focusGained(fe);
                if(getText().equals(getFrase())){
                    setText("");
                    setForeground(colorTexto);
                }
                
            }

            @Override
            public void focusLost(FocusEvent fe) {
                super.focusLost(fe);
                if(getText().equals("")){
                    setText(getFrase());
                    setForeground(colorsub);
                }
            }
            
            
            
        
        });
    
         if(getText().equals("")){
                    setText(getFrase());
                    setForeground(colorsub);
                }

    }

   
    public String getFrase() {
        return Frase;
    }

  
    public void setFrase(String Frase) {
        this.Frase = Frase;
    }

}
